www.gusucode.com > 婚庆仪礼策划公司网站系统源代码 梦紫色 > 婚庆仪礼策划公司网站系统源代码 梦紫色/Admin/复件 admin_pro.asp
<!--#include file="conn.asp"--> <!--#include file="inc/format.asp"--> <!--#include file="inc/error.asp"--> <!--#include file="check1.asp"--> <!--#include file="inc/pro_body.asp"--> <title>文章管理</title> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <% dim founderr,errmsg founderr=false errmsg="" if session("admin_flag")<>"into" then founderr=true errmsg=errmsg+"<br>"+"<li>你尚未登录,或者超时了!请<a href='login.asp' target='_parent' >重新登录</a>!" Call diserror() response.End else dim sql_test,rs_test sql_test="select * from p_class" set rs_test=server.createobject("adodb.recordset") rs_test.open sql_test,conn,1,1 if rs_test.BOF and rs_test.EOF then rs_test.close set rs_test=Nothing 'coon.close 'set conn=Nothing founderr=true errmsg=errmsg+"<br>"+"<li>你还没有输入文章的分类,不能输入文章!请<a href='admin_p.asp?action=newp' target='_self' >加入新类</a>!" Call diserror() response.End End if dim p_name,p_spec,upfile,p_epitome,p_class_id,p_other,fenzi if Request.form("MM_insert") then if request.form("action")="newpro" then dim evs,evs_sql,evs_rs evs_sql="select count(p_id) from p_info" set evs_rs=conn.execute(evs_sql) if Not(evs_rs.bof or evs_rs.eof) then if evs_rs(0)>10000 then Response.redirect("admin_pro.asp") response.end() end if evs_rs.close set ev_rs=nothing end if '++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= sql="select * from p_info" set rs=server.createobject("adodb.recordset") rs.open sql,conn,1,3 rs.addnew p_name=trim(replace(request.form("p_name"),"'","")) p_spec=trim(replace(request.form("p_spec"),"'","")) fenzi=trim(replace(request.form("fenzi"),"'","")) p_pic=trim(replace(request.form("p_pic"),"'","")) p_epitome=trim(replace(request.form("p_epitome"),"'","")) p_small_type=trim(replace(request.form("p_small_type"),"'","")) p_type=trim(replace(request.form("p_type"),"'","")) p_other=trim(replace(request.form("p_other"),"'","")) p_jianjie=trim(replace(request.form("p_jianjie"),"'","")) p_name_e=trim(replace(request.form("p_name_e"),"'","")) p_spec_e=trim(replace(request.form("p_spec_e"),"'","")) p_epitome_e=trim(replace(request.form("p_epitome_e"),"'","")) p_jianjie_e=trim(replace(request.form("p_jianjie_e"),"'","")) P_order1 = trim(replace(request.form("P_order1"),"'","")) if p_other="" then rs("p_other")=0 else rs("p_other")=1 End if if p_name="" then founderr=true errmsg=errmsg+"<br>"+"<li>你必须输入文章名称!" else rs("p_name")=p_name End if if p_spec<>"" then 'founderr=true ' errmsg=errmsg+"<br>"+"<li>你必须输入文章的型号!" 'else rs("p_spec")=p_spec End if if fenzi<>"" then 'founderr=true ' errmsg=errmsg+"<br>"+"<li>你必须输入文章的型号!" 'else rs("fenzi")=fenzi End if if p_pic="" then founderr=true errmsg=errmsg+"<br>"+"<li>你必须输入文章的化学结构!" else rs("p_pic")=p_pic End if if p_type="" then founderr=true errmsg=errmsg+"<br>"+"<li>你必须输入文章的大分类!"'else else rs("p_type")=p_type End if '由P_type,p_small_type 得到p_type_e和p_small_tyPe_e if trim(p_small_type) <> "" then sql_p="select p_type_e,p_small_type_e from p_class_small where p_type='"&p_type&"' and p_small_type='"&p_small_type&"'" set rs_p=server.createobject("adodb.recordset") rs_p.open sql_p,conn,1,1 if Not(rs_p.BOF and rs_p.EOF) then p_type_e=rs_p("p_type_e") p_small_type_e=rs_p("p_small_type_e") end if rs_p.close set rs_p=nothing else sql_p="select p_type_e from p_class where p_type='"&p_type&"'" set rs_p=server.createobject("adodb.recordset") rs_p.open sql_p,conn,1,1 if Not(rs_p.BOF and rs_p.EOF) then p_type_e=rs_p("p_type_e") end if rs_p.close set rs_p=nothing end if rs("p_small_type")=p_small_type rs("p_epitome")=p_epitome '详细说明 rs("p_jianjie")=p_jianjie'简单说明p_order2 rs("p_order")=p_order1 '英文方面 rs("p_name_e")=p_name_e rs("p_spec_e")=p_spec_e rs("p_epitome_e")=p_epitome_e rs("p_small_type_e")=p_small_type_e rs("p_type_e")=p_type_e rs("p_jianjie_e")=p_jianjie_e if Not founderr then rs.update rs.close set rs=Nothing closedatabase Response.write "<script language = 'javascript'>alert('成功添加一个文章!');window.document.location.href='admin_pro.asp';</script>" response.end else Call diserror() response.End End if End if '++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= if request.form("action")="editpro" then if request.Form("id")="" then founderr=true errmsg=errmsg+"<br>"+"<li>你必须指定操作的对象!" else if Not isInteger(request.form("id")) then founderr=true errmsg=errmsg+"<br>"+"<li>非法的id参数。" End if End if if founderr then Call diserror() response.End End if sql="select * from p_info where p_id="&cint(request.Form("id")) set rs=server.createobject("adodb.recordset") rs.open sql,conn,1,3 p_name=trim(replace(request.form("p_name"),"'","")) p_spec=trim(replace(request.form("p_spec"),"'","")) fenzi=trim(replace(request.form("fenzi"),"'","")) upfile=trim(replace(request.form("upfile"),"'","")) p_pic=trim(replace(request.form("p_pic"),"'","")) p_epitome=trim(replace(request.form("p_epitome"),"'","’")) p_small_type=trim(replace(request.form("p_small_type"),"'","")) p_type=trim(replace(request.form("p_type"),"'","")) p_other=trim(replace(request.form("p_other"),"'","")) p_jianjie=trim(replace(request.form("p_jianjie"),"'","")) p_order=trim(replace(request.form("p_order"),"'","")) p_name_e=trim(replace(request.form("p_name_e"),"'","")) p_spec_e=trim(replace(request.form("p_spec_e"),"'","")) p_epitome_e=trim(replace(request.form("p_epitome_e"),"'","’")) p_small_type_e=trim(replace(request.form("p_small_type_e"),"'","")) p_type_e=trim(replace(request.form("p_type_e"),"'","")) p_jianjie_e=trim(replace(request.form("p_jianjie_e"),"'","")) if p_other="" then rs("p_other")=0 else rs("p_other")=1 End if if p_name="" then founderr=true errmsg=errmsg+"<br>"+"<li>你必须输入文章名称!" else rs("p_name")=p_name End if if p_spec<>"" then ' founderr=true 'errmsg=errmsg+"<br>"+"<li>你必须输入文章的型号!" 'else rs("p_spec")=p_spec End if if fenzi<>"" then ' founderr=true 'errmsg=errmsg+"<br>"+"<li>你必须输入文章的型号!" 'else rs("fenzi")=fenzi End if if p_pic="" then founderr=true errmsg=errmsg+"<br>"+"<li>你必须输入文章的化学结构!" else rs("p_pic")=p_pic End if if p_type="" then founderr=true errmsg=errmsg+"<br>"+"<li>你必须输入文章的大分类!"'else else rs("p_type")=p_type End if '由P_type,p_small_type 得到p_type_e和p_small_tyPe_e if trim(p_small_type)<> "" then sql_p="select p_type_e,p_small_type_e from p_class_small where p_type='"&p_type&"' and p_small_type='"&p_small_type&"'" set rs_p=server.createobject("adodb.recordset") rs_p.open sql_p,conn,1,1 if Not(rs_p.BOF and rs_p.EOF) then p_type_e=rs_p("p_type_e") p_small_type_e=rs_p("p_small_type_e") end if rs_p.close set rs_p=nothing else sql_p="select p_type_e from p_class where p_type='"&p_type&"'" set rs_p=server.createobject("adodb.recordset") rs_p.open sql_p,conn,1,1 if Not(rs_p.BOF and rs_p.EOF) then p_type_e=rs_p("p_type_e") end if rs_p.close set rs_p=nothing end if rs("p_small_type")=p_small_type rs("p_epitome")=p_epitome '详细说明 rs("p_jianjie")=p_jianjie'简单说明 rs("p_order")=p_order '英文方面 rs("p_name_e")=p_name_e rs("p_spec_e")=p_spec_e rs("p_epitome_e")=p_epitome_e rs("p_small_type_e")=p_small_type_e rs("p_type_e")=p_type_e rs("p_jianjie_e")=p_jianjie_e if Not founderr then rs.update rs.close set rs=Nothing Response.write "<script language = 'javascript'>alert('成功修改了此文章!');window.document.location.href='admin_pro.asp';</script>" response.end else Call diserror() response.End End if End if '++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= if request.form("action")="delpro" then if request.Form("id")="" then founderr=true errmsg=errmsg+"<br>"+"<li>你必须指定操作的对象!" else if Not isInteger(request.form("id")) then founderr=true errmsg=errmsg+"<br>"+"<li>非法的id参数。" End if End if if founderr then Call diserror() response.End End if sql="select * from p_info where p_id="&cint(request.Form("id")) set rs=server.createobject("adodb.recordset") rs.open sql,conn,1,3 rs.delete rs.close set rs=Nothing closedatabase Response.write "<script language = 'javascript'>alert('成功删除此文章!');window.document.location.href='admin_pro.asp';</script>" response.end End if End if Call adminpro_body() closedatabase End if %>